﻿@using Windvoice.Blog
@using Windvoice.Library.Mvc;
@{
    ViewBag.Title = "Blogs";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<div class="body-left">
    @if (ViewBag.Category != null)
    {
        <div class="categorytitle">
            @ViewBag.RecordCount blogs in category <b>@(((Category)ViewBag.Category).Name)</b>.
        </div>
    }
    <ul class="blogs-list">
        @foreach (var blog in (Article[])ViewBag.Blogs)
        {
            var category = Category.Find(blog.CategoryID);
            <li class="blogs-item">
                <div class="upper">
                    <div class="weather">
                        <img src="/Content/images/weather/@(blog.Weather).png" width="24" height="24" />
                    </div>
                    <h3><a href="/blog/@blog.UniqueKey">@blog.Title</a></h3>
                    <div class="category">
                        <a href="/blogs/@category.UniqueKey">@category.Name</a>
                    </div>
                    <div class="clear"></div>
                </div>
                <div class="lower">
                    <div class="tailinfo">Created on @blog.CreateTime.ToString("yyyy-MM-dd HH:mm:ss"), @Comment.GetCommentCount(blog.ID) commets, @blog.Hits℃</div>
                </div>
            </li> 
        }
    </ul>

    @Html.Pager((int)ViewBag.RecordCount,"manu",pageSize:(int)ViewBag.PageSize)
</div>

@Html.Partial("_PartialRight")
<div class="clear"></div>